/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* 标题样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #2c3e50;
    color: white;
    border-radius: 8px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 消息提示样式 */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 15px;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    margin-bottom: 10px;
    border-radius: 4px;
    color: #1565c0;
}

/* 搜索和新建按钮区域样式 */
.search-and-create {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form {
    flex: 1;
    display: flex;
    max-width: 500px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-form button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #2980b9;
}

.create-btn {
    padding: 10px 20px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.create-btn:hover {
    background-color: #27ae60;
}

/* 统计信息样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-item h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-item p {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

/* 日记列表样式 */
.diary-list {
    margin-bottom: 30px;
}

.diary-list h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.diary-list ul {
    list-style-type: none;
}

.diary-entry {
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.diary-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.entry-header h3 {
    margin: 0;
    color: #2c3e50;
    flex: 1;
}

.entry-header a {
    text-decoration: none;
    color: inherit;
}

.entry-header a:hover {
    color: #3498db;
}

.entry-actions {
    display: flex;
    gap: 10px;
}

.edit-btn,
.delete-btn {
    padding: 5px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.edit-btn {
    background-color: #3498db;
    color: white;
}

.edit-btn:hover {
    background-color: #2980b9;
    color: white;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
    color: white;
}

.entry-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

.entry-preview {
    color: #555;
    line-height: 1.6;
}

.no-entries {
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.no-entries h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: none;
}

.no-entries p {
    color: #7f8c8d;
}

/* 编辑页面样式 */
.edit-container {
    max-width: 800px;
    margin: 0 auto;
}

.edit-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 300px;
}

.entry-info {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
}

.entry-info p {
    margin: 5px 0;
    color: #7f8c8d;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.save-btn,
.cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.save-btn {
    background-color: #2ecc71;
    color: white;
}

.save-btn:hover {
    background-color: #27ae60;
}

.cancel-btn {
    background-color: #95a5a6;
    color: white;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .search-and-create {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        max-width: 100%;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .entry-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .entry-actions {
        justify-content: flex-end;
    }
    
    .entry-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}